Ext.define("wmf.store.access.access", {
    extend: "Ext.data.Store",
    model: "wmf.model.access.access",
	requires: [
	],
	rootVisible: true,
	pageSize: 20,
    proxy: {
        type: 'ajax',
        url: 'link/getLinkList.do',
        reader: {
            type: 'json',
            root: 'list'
        }
    },
    listeners : {  
        beforeload : function(store, operation) {
        	var page = operation.page;
        	var start = (page-1) * 20;
        	if(wmf.access.init == true){
        		wmf.access.params.start = 0;
        		wmf.access.init = false;
        	}else{
        		wmf.access.params.start = start;
        	}
        	wmf.access.params.limit = 20;
            var params = wmf.access.params;  
            store.proxy.extraParams = {};
       		Ext.apply(store.proxy.extraParams, params);
        }  
    },
	storeId: 'access.access'
});